<template>
  <a-modal
    v-model:visible="props.applyVisible"
    title="评阅完成上报"
    :width="400"
    @cancel="emits('update:applyVisible', false)"
    @ok="handleSignAbnormal"
  >
    <div class="px-3 pt-3">
      <a-form ref="setForm" :model="form">
        <a-form-item name="remark">
          <a-textarea v-model:value="form.remark" placeholder="请输入申请备注信息" />
        </a-form-item>
      </a-form>
    </div>
  </a-modal>
</template>

<script setup last="ts">
import { reactive, watch, ref, nextTick } from 'vue'
const Data = reactive({
  pointPyAccount: null,
})

const setForm = ref(null)
function handleSignAbnormal() {
  setForm.value.validate().then(() => {
    emits('success', form.value?.remark)
    emits('update:applyVisible', false)
    nextTick(() => {
      setForm.value.resetFields()
    })
  })
}
const props = defineProps({
  applyVisible: {
    type: Boolean,
    default: false,
  },
})
const emits = defineEmits(['update:applyVisible', 'success'])

const form = ref({})
</script>
